package com.example.landlord.demo.Controller;

import com.example.landlord.demo.Common.Result;
import com.example.landlord.demo.Controller.request.ForgetRequest;
import com.example.landlord.demo.Controller.request.RegisterRequest;
import com.example.landlord.demo.Service.IUserService;
import com.example.landlord.demo.Service.Impl.SendEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/send")
public class SendEmailController {
    @Autowired
    SendEmailService mailService;
    @Autowired
    IUserService userService;
    @PostMapping("/email")
    public Result sendSimpleEmail(@RequestBody RegisterRequest request){
        mailService.sendcodeEmail(request);
        return Result.success();
    }
    @PostMapping("/emailpwd")
    public Result sendPassword(@RequestBody ForgetRequest request){
        mailService.sendPassword(request);
        return Result.success();
    }

}
